home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Examples / Calc / CalcUtilities.h < prev    next >
Encoding:
Text File  |  1996-04-03  |  1.4 KB  |  72 lines  |  [TEXT/MPS ]

  1. // CalcUtilities.h
  2. // Copyright © 1986-96 by Apple Computer, Inc. All rights reserved. 
  3.  
  4. /*
  5.     This unit contains some utility routines for the Calc sample application.
  6.     It demonstrates how to use a library unit in a MacApp™ application.
  7. */
  8.  
  9. #ifndef __CALCUTILITIES__
  10. #define __CALCUTILITIES__
  11.  
  12. /* • requirements for this unit's interface. */
  13.  
  14. // MacApp
  15.  
  16. #ifndef __MACAPPTYPES__
  17. #include "MacAppTypes.h"
  18. #endif
  19.  
  20. #ifndef __UGEOMETRY__
  21. #include "UGeometry.h"
  22. #endif
  23.  
  24. // Toolbox
  25.  
  26. #ifndef __QUICKDRAW__
  27. #include <Quickdraw.h>
  28. #endif
  29.  
  30.  
  31.  
  32.         // Formatting and Drawing routines 
  33.  
  34.         void FitString(CStr255& theString,
  35.                        short maxWidth);
  36.  
  37.         CRect GetRgnBounds(RgnHandle aRgn);
  38.         // returns the enclosed CRect of the rgn's bbox (subtracts 1 from right and bottom) 
  39.  
  40.         Boolean IsDigit(char Ch);
  41.  
  42.         void SetEditCommandName(CommandNumber theCommand, 
  43.                                 CommandNumber customCommand);
  44.  
  45.         void SetTheFont(short fontNumber, 
  46.                         short fontSize,
  47.                         Style fontStyle);
  48.  
  49.         void SmartDrawString(CStr255& theString,
  50.                              CRect area,
  51.                              short justification);
  52.  
  53.         // Reading and Writing 
  54.  
  55.         void ReadScrap(Handle theScrap,
  56.                        long& scrapOffset,
  57.                        unsigned char* theData,
  58.                        short dataLength);
  59.  
  60.         void WriteScrap(Handle theScrap,
  61.                         long& scrapOffset,
  62.                         unsigned char* theData,
  63.                         short dataLength);
  64.  
  65.         // Max & Min overloaded functions
  66.         short Max(short a, short b);
  67.         
  68.         short Min(short a, short b);
  69.         
  70.  
  71. #endif
  72.